<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta name="keywords" content="#">
    <meta name="description" content="#">
    
	<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
	<style type="text/css">
	
/*  		body, html{width: 100%;height: 100%;margin:0;font-family:"微软雅黑";font-size:14px;}  */
		#l-map{height:300px;width:100%;} 
 		#r-result{width:100%;} */
		
	</style>
	<script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=35H57hLd7xZDPHZLeei009U8WU03tIei"></script>
	
    <title>Scenic Detail</title>
    <!-- Fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/images/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/images/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/images/favicon.ico">
    <link rel="apple-touch-icon-precomposed" href="assets/images/favicon.ico">
    <link rel="shortcut icon" href="assets/images/favicon.ico">
    <!-- Bootstrap -->
    <link href="assets/css/bootstrap.min.css" rel="stylesheet">
    <!-- Fontawesome -->
    <link href="assets/css/font-awesome.css" rel="stylesheet">
    <!-- Flaticons -->
    <link href="assets/css/font/flaticon.css" rel="stylesheet">
    <!-- Slick Slider -->
    <link href="assets/css/slick.css" rel="stylesheet">
    <!-- Range Slider -->
    <link href="assets/css/ion.rangeSlider.min.css" rel="stylesheet">
    <!-- Datepicker -->
    <link href="assets/css/datepicker.css" rel="stylesheet">
    <!-- magnific popup -->
    <link href="assets/css/magnific-popup.css" rel="stylesheet">
    <!-- Nice Select -->
    <link href="assets/css/nice-select.css" rel="stylesheet">
    <!-- Custom Stylesheet -->
    <link href="assets/css/style.css" rel="stylesheet">
    <!-- Custom Responsive -->
    <link href="assets/css/responsive.css" rel="stylesheet">
    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700&display=swap" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet">
   
</head>
<body>
    <!-- Start Header -->
    <header class="header">
        <!-- Topbar -->
        <div class="topbar bg-custom-blue">
            <div class="container">
                <div class="row">
                    <div class="col-sm-6">
                        <div class="left-side">
                            <ul class="custom-flex">
                                <li>
                                    <a href="#" class="text-custom-white">
                                        <i class="fab fa-facebook-f"></i>
                                    </a>
                                </li>
                                <li>
                                    <a href="#" class="text-custom-white">
                                        <i class="fab fa-twitter"></i>
                                    </a>
                                </li>
                                <li>
                                    <a href="#" class="text-custom-white">
                                        <i class="fab fa-instagram"></i>
                                    </a>
                                </li>
                                <li>
                                    <a href="#" class="text-custom-white">
                                        <i class="fab fa-linkedin"></i>
                                    </a>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <div class="col-sm-6">
						<div class="right-side">
							<ul class="custom-flex" id="custom-flex">
							
								
							</ul>
						</div>
					</div>
                </div>
            </div>
        </div>
        <!-- Topbar -->
        <!-- Navigation -->
        <div class="navigation">
            <div class="container">
                <div class="row">
                    <div class="col-12">
                        <div class="main-navigation">
                            <div class="logo">
                                <a href="index.html">
                                    <img  src="assets/images/TuYang-logo.png" class="img-fluid image-fit" alt="img">
                                </a>
                            </div>
                            <div class="main-menu">
                                <div class="logo">
                                    <a href="index.html">
                                      <img src="assets/images/toor-logo.png" class="img-fluid image-fit" alt="img">
                                    </a>
                                </div>
                                <nav>
                                   <ul class="custom-flex">
                                        <li class="menu-item">
                                            <a href="index.jsp" class="text-light-dark">首页</a>
                                            
                                        </li>
                                        <li class="menu-item ">
                                            <a href="rooms-hotels.jsp" class="text-light-dark">酒店</a>
                                            
                                        </li>
                                        <li class="menu-item active">
                                            <a href="scenic.jsp" class="text-light-dark">景点</a>
                                            
                                        </li>
                                        
                                        <li class="menu-item">
                                            <a href="order.jsp" class="text-light-dark">我的订单</a>
                                        </li>
                                        <li class="menu-item">
                                            <a href="gallery.jsp" class="text-light-dark">我的收藏</a>
                                            
                                        </li>
                                        <li class="menu-item">
                                            <a href="person-center.jsp" class="text-light-dark">个人中心</a>
                                           
                                        </li>
                                    </ul>
                                </nav>
                            </div>
                           
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Navigation -->
    </header>
    <!-- End Header -->
    <!-- Start Subheader -->
    <div class="subheader normal-bg section-padding">
        <div class="container">
            <div class="row">
                <div class="col-12">
                    <h1 class="text-custom-white">Scenic Detail</h1>
                    <ul class="custom-flex justify-content-center">
                        <li class="fw-500">
                            <a href="index.jsp" class="text-custom-white">Home</a>
                        </li>
                        <li class="fw-500">
                            <a href="scenic.jsp" class="text-custom-white">景点</a>
                        </li>
                        <li class="active fw-500">
                            	景点详情
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <!-- End Subheader -->
    <!-- Start Listing detail -->
    <section class="section-padding bg-light-white listing-details">
        <div class="container">
            <div class="row">
                <div class="col-12">
                    <div class="listing-details-inner bx-wrapper bg-custom-white padding-20">
                        <div class="row">
                            <div class="col-lg-8">
                                <div class="detail-slider-for mb-xl-20 magnific-gallery">
                                    <div id="scenicPicture" class="slide-item" >
                                            <img  id="scenicPictureProp"  src="assets/images/flights/flight.jpg" class="image-fit" alt="img">
                                    </div>
                                </div>
                                <hr>
                                <div class="listing-meta-sec mb-md-80">
                                   
                                   
                        <div class="blog-meta bg-custom-white">
                                    <div class="post-meta-box mb-xl-20">
                                        <div>
                                            <a href="#" class="text-custom-black fs-18">Scenic Comment</a>
                                        </div>
                                        <div class="post-meta">
                                            <a href="#" class="text-light-dark " tabindex="-1">
                                                <span class="text-custom-blue">
                                                    <i class="fas fa-comment"></i>
                                                </span> 2000
                                            </a>
                                            <a href="#" class="text-light-dark mr-2" tabindex="-1">
                                                <span class="text-custom-blue">
                                                    <i class="fas fa-thumbs-up"></i>
                                                </span> 5000
                                            </a>
                                            <a href="#" class="text-light-dark mr-2" tabindex="-1">
                                                <span class="text-custom-blue">
                                                    <i class="fas fa-eye"></i>
                                                </span> 8000
                                            </a>
                                            <div class="post-date">
                                                <div class="text-custom-white bg-custom-blue fw-600 date">November 2020</div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="post-heading p-relative">
                                        <h2><a href="#" class="text-custom-black" style="font-size:27px;">语言也会伤害人，请友善交流！</a></h2>
                                    </div>
                                    <div class="post-author mb-xl-20" id="scenicComment" style="height:600px;overflow:auto;">
                                        <div class="author-img animate-img">
                                            <a href="#">
                                                <img style="width:80px;height:80px;" src="assets/images/blog/author-img.png" class="rounded-circle" alt="#">
                                                <span class="text-theme fs-14">用户名</span>
                                            </a>
                                        </div>
                                         <p class="text-light-dark">
                                        		评论内容
                                    	</p>
                                    </div>
                                   
                                   
                                    
                                    
                                </div>
                                
                         
                        <div class="form-group" style="margin-top:40px;">
                             <input style="width:300px;float:left;" type="text" name="#" class="form-control form-control-custom" placeholder="写评论..." id="inputScenicComment">
                             <button id="publishCommentScenic" style="width:100px;float:left;margin-left:5px;" type="button" class="btn-first btn-submit full-width btn-height" style="margin-top:15px;">发布</button> 
                        </div>
                                </div>
                            </div>
                            <div class="col-lg-4">
                                <div class="row">
                                    <div class="col-12">
                                        <div class="quick-quote bx-wrapper padding-20 mb-xl-30">
                                            <h5 class="text-custom-black">预订门票</h5>
                                            <form>
                                                <div class="row">
                                                    <div class="col-12">
                                                        <div class="form-group">
                                                            <label class="fs-14 text-custom-black fw-500">景点名称</label>
                                                            <input type="text" name="#" class="form-control form-control-custom" readOnly="readOnly" placeholder="" id="scenicName">
                                                        </div>
                                                        
                                                        <div class="form-group">
                                                            <label class="fs-14 text-custom-black fw-500">景点描述</label>
                                                            <textarea rows="5" cols="6" id="scenicDesc" name="scenicDesc"  class="form-control form-control-custom" readOnly="readOnly"></textarea>
                                                        </div>
                                                        
                                                        <div class="form-group">
                                                            <label class="fs-14 text-custom-black fw-500">景点门票</label>
                                                            <input type="text" name="#" class="form-control form-control-custom" readOnly="readOnly" placeholder="" id="scenicPrice">
                                                        </div>
                                                        <button id="btnBook" type="button" class="btn-first btn-submit full-width btn-height" style="margin-top:15px;" data-toggle="modal" data-target="#modifyModal">立即预订</button>
                                                    </div>
                                                </div>
                                            </form>
                                        </div>
                                        <div class="flights-grid mb-xl-30" style="margin-top:100px;">
                                            <div class="flights-grid-wrapper bx-wrapper">
                                                
                                                <div id="l-map"></div>
												<div style="margin-top:60px;margin-left:40px;" id="r-result"><button type="button" disabled="disabled"; class="btn-first full-width btn-height" style="width:100px;margin-right:15px;border-color: #01b7f2;color: #01b7f2;">景点搜索：</button>
												<input type="text" class="suggestClass" id="suggestId" size="20" value="" style="width:150px;"/></div>
												<div id="searchResultPanel" style="border:1px solid #C0C0C0;width:150px;height:auto; display:none;"></div>
												
												
                                            </div>
                                        </div>
                                        
                                        
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- End Listing detail -->
    <!-- Start Partners -->
    
    <!-- End Partners -->
    <!-- Start Footer -->
       <footer class="section-padding footer">
        <div class="container">
            <div class="row">
                <div class="col-lg-3 col-md-6">
                    <div class="footer-box mb-md-40">
                        <h4 class="text-custom-white fw-600">About Us</h4>
                        <p class="text-custom-white">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.</p>
                        <p class="text-custom-white">
                            Lorem Ipsum is simply dummy text of the printing and typesetting industry...
                        </p>
                        <ul class="custom-flex socials">
                            <li><a href="#" class="text-custom-white fs-14"><i class="fab fa-facebook-f"></i></a></li>
                            <li><a href="#" class="text-custom-white fs-14"><i class="fab fa-twitter"></i></a></li>
                            <li><a href="#" class="text-custom-white fs-14"><i class="fab fa-linkedin"></i></a></li>
                            <li><a href="#" class="text-custom-white fs-14"><i class="fab fa-youtube"></i></a></li>
                        </ul>
                    </div>
                </div>
                <div class="col-lg-3 col-md-6">
                    <div class="footer-box mb-md-40">
                        <h4 class="text-custom-white fw-600">Quick Links</h4>
                        <ul class="custom links">
                            <li>
                                <a href="#" class="text-custom-white">Home</a>
                            </li>
                            <li>
                                <a href="#" class="text-custom-white">Hotels</a>
                            </li>
                            <li>
                                <a href="#" class="text-custom-white">Flights</a>
                            </li>
                            <li>
                                <a href="#" class="text-custom-white">Cruise</a>
                            </li>
                            <li>
                                <a href="#" class="text-custom-white">Blog</a>
                            </li>
                            <li>
                                <a href="#" class="text-custom-white">404</a>
                            </li>
                            <li>
                                <a href="#" class="text-custom-white">Contact Us</a>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="col-lg-3 col-md-6">
                    <div class="footer-box mb-sm-40">
                        <h4 class="text-custom-white fw-600">Instagram</h4>
                        <ul class="custom instagram " style="position: relative; height: 204px;">
                            <li style="position: absolute; left: 0px; top: 0px;">
                                <a href="#" class="text-custom-white popup">
                                    <img src="assets/images/gallery/g_gal_1.jpg" class="image-fit" alt="img">
                                </a>
                            </li>
                            <li style="position: absolute; left: 84.1406px; top: 0px;">
                                <a href="#" class="text-custom-white popup">
                                    <img src="assets/images/gallery/g_gal_2.jpg" class="image-fit" alt="img">
                                </a>
                            </li>
                            <li style="position: absolute; left: 168.281px; top: 0px;">
                                <a href="#" class="text-custom-white popup">
                                    <img src="assets/images/gallery/g_gal_3.jpg" class="image-fit" alt="img">
                                </a>
                            </li>
                            <li style="position: absolute; left: 0px; top: 68px;">
                                <a href="#" class="text-custom-white popup">
                                    <img src="assets/images/gallery/g_gal_4.jpg" class="image-fit" alt="img">
                                </a>
                            </li>
                            <li style="position: absolute; left: 84.1406px; top: 68px;">
                                <a href="#" class="text-custom-white popup">
                                    <img src="assets/images/gallery/g_gal_5.jpg" class="image-fit" alt="img">
                                </a>
                            </li>
                            <li style="position: absolute; left: 168.281px; top: 68px;">
                                <a href="#" class="text-custom-white popup">
                                    <img src="assets/images/gallery/g_gal_6.jpg" class="image-fit" alt="img">
                                </a>
                            </li>
                            <li style="position: absolute; left: 0px; top: 136px;">
                                <a href="#" class="text-custom-white popup">
                                    <img src="assets/images/gallery/g_gal_7.jpg" class="image-fit" alt="img">
                                </a>
                            </li>
                            <li style="position: absolute; left: 84.1406px; top: 136px;">
                                <a href="#" class="text-custom-white popup">
                                    <img src="assets/images/gallery/g_gal_8.jpg" class="image-fit" alt="img">
                                </a>
                            </li>
                            <li style="position: absolute; left: 168.281px; top: 136px;">
                                <a href="#" class="text-custom-white popup">
                                    <img src="assets/images/gallery/g_gal_9.jpg" class="image-fit" alt="img">
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="col-lg-3 col-md-6">
                    <div class="footer-box mb-sm-40">
                        <h4 class="text-custom-white fw-600">Newsletter</h4>
                        <div class="newsletter">
                            <p class="text-custom-white">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </footer>
    <!-- End Footer -->
    <!-- Start Copyright -->
    <div class="copyright">
        <div class="container">
            <div class="row">
                <div class="col-12">
                    <p class="text-custom-white">Copyright &copy; 2020.Company name All rights reserved.</p>
                </div>
            </div>
        </div>
    </div>
    
    
    
    
	
	<!-- 模态框 -->
<div class="modal fade" id="modifyModal">
  <div class="modal-dialog">
    <div class="modal-content">
 
      <!-- 模态框头部 -->
      <div class="modal-header">
        <h4 class="modal-title">填写订单</h4>
      	</div>
 
      <!-- 模态框主体 -->
      <div class="modal-body">
        	<form action="" id="update-form" method="post" enctype="multipart/form-data">
				<input type="hidden" name="op" value="modify">
				<label class="col-sm-6">景点编号：</label>
				<div class="col-sm-10" style="margin-bottom:10px;">
					<input type="text"  id="scenicid" name="scenicid" readonly="readonly">
				</div>
				<label class="col-sm-6">景点名称：</label>
				<div class="col-sm-10" style="margin-bottom:10px;">
					<input type="text"  id="scenicname" name="scenicname" readOnly="readOnly">
					
				</div>
				
				<label  class="col-sm-6">景点门票：</label>
				<div class="col-sm-10">
					<div style="background: orange;width:60px"><span id="scenicCount">1</span><label>张票</label></div>
					<input class="sub" type="button" value="-">
					<input type="text" id="scenicprice" name="scenicprice" readonly="readonly">
					<input class="add" type="button" value="+">
				</div>
				
				<div class="col-sm-10">
					<button type="button" class="btn btn-primary" id="update-btn" style="margin-top:20px;color: #fff;background-color: #ff5000;border: 1px solid #ff5000;border-radius: 4px;text-align: center;cursor: pointer;">去付款</button>
				</div>
			</form>
      </div>
 
      <!-- 模态框底部 -->
      <div class="modal-footer">
        	<button id="btnClose" type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
      </div>
 
    </div>
  </div>
</div>

    <!-- End Copyright -->
    <div id="back-top" class="back-top">
      <a href="#top"><i class="flaticon-arrows"></i></a>
    </div>
    <!-- Place all Scripts Here -->
    <!-- jQuery -->
    

    <script src="assets/js/jquery.min.js"></script>
    <!-- Popper -->
    <script src="assets/js/popper.min.js"></script>
    <!-- Bootstrap -->
    <script src="assets/js/bootstrap.min.js"></script>
    <!-- Range Slider -->
    <script src="assets/js/ion.rangeSlider.min.js"></script>
    <!-- Slick Slider -->
    <script src="assets/js/slick.min.js"></script>
    <!-- Datepicker -->
    <script src="assets/js/datepicker.js"></script>
    <script src="assets/js/datepicker.en.js"></script>
    <!-- Isotope Gallery -->
    <script src="assets/js/isotope.pkgd.min.js"></script>
    <!-- Nice Select -->
    <script src="assets/js/jquery.nice-select.js"></script>
    <!-- magnific popup -->
    <script src="assets/js/jquery.magnific-popup.min.js"></script>
    <!-- Maps -->
    <script src="https://ditu.google.cn/maps/api/js?key=AIzaSyDnd9JwZvXty-1gHZihMoFhJtCXmHfeRQg"></script>
    <!-- Custom Js -->
    <script src="assets/js/custom.js"></script>
    <!-- /Place all Scripts Here -->
</body>
<script>
	$(document).ready(function(){
		//显示用户名和用户图片
		var user ="${sessionScope.user}";
		if(user!=""&&"${sessionScope.user.userPicture}"==null){
			$("#custom-flex").html("<li><img src=\"${pageContext.request.contextPath}/assets/images/dahaigui.jpg\"><li><li>用户名："+"${sessionScope.user.userName}"+"</li>");
		}else if(user!=""&&"${sessionScope.user.userPicture}"!=null){
			$("#custom-flex").html("<li><img style=\"width:30px;height:30px;  \" src=\"${pageContext.request.contextPath}/FileDownloadServlet?fileName="+
					"${sessionScope.user.userPicture}"+"\"><li>"+
					"<li>用户名："+"${sessionScope.user.userName}"+
					"<span style=\"margin-left:60px;cursor:pointer;\" id=\"btnLogout\">退出登录</span>"+
					"</li>");
		}else if(user==""){
			$("#custom-flex").html("<li><a href=\"userLogin.jsp\" class=\"text-custom-white\">登录</a></li>"+
					"<li><a href=\"register.jsp\" class=\"text-custom-white\">注册</a></li>");
		}
		
		$(".sub").prop("disabled",true); // 减号设置为禁用
		var scenicIdValue = <%=request.getParameter("scenicId")%>
		var scenicNameValue = <%=request.getParameter("scenicName")%>;
		$("#scenicName").val(scenicNameValue);
		
		var scenicPriceValue = <%=request.getParameter("scenicPrice")%>;
		$("#scenicPrice").val(scenicPriceValue);
		var scenicDescValue = <%=request.getParameter("scenicDesc")%>;
		$("#scenicDesc").val(scenicDescValue);
<%-- 		var scenicPictureValue = <%=request.getParameter("scenicPicture")%>; --%>
//  		$("#scenicPicture").val(scenicPictureValue);
		
		$("#scenicPictureProp").prop("src","../FileDownloadServlet?fileName=" + <%=request.getParameter("scenicPicture")%>);

		// 点击立即预订,填充原始数据
		$(document).on("click","#btnBook",function(){
		
  			// 将文章的原始数组渲染到指定位置上
  			$("#modifyModal #scenicid").val(scenicIdValue);
  			$("#modifyModal #scenicname").val(scenicNameValue);
  			$("#modifyModal #scenicprice").val(scenicPriceValue);
		});
		
		// 加号按钮
		$(document).on("click",".add",function(){
			// 对减号进行释放，设置可用
			$(this).siblings(".sub").prop("disabled",false);
			// $(this)是加号按钮
			var $numberObject = $(this).prev();// 获取数量框对象
			var oldNumber = $numberObject.val(); // 获取旧的数量值
			var oldCount = $("#scenicCount").text();
			var newCount = parseInt(oldCount)+1;
			var newNumber = parseInt(oldNumber)+parseInt(scenicPriceValue); // +1
			$numberObject.val(newNumber) // 重新赋值
			 $("#scenicCount").text(newCount);
				
		});
		
		// 减号按钮
		$(document).on("click",".sub",function(){
			console.log(1);
			// $(this)是减号按钮
			var $numberObject = $(this).next();// 获取数量框对象
			var oldNumber = $numberObject.val(); // 获取旧的数量值
			
			var newNumber = parseInt(oldNumber)-parseInt(scenicPriceValue); // -1
			var oldCount = $("#scenicCount").text();
			var newCount = parseInt(oldCount)-1;
			// 效验数量
			if(newNumber <= parseInt(scenicPriceValue)){
				if(newCount==20){
					$("#scenicCount").text("1");
				}
				newNumber = parseInt(scenicPriceValue); // 直接设置为最低价格
				$(this).prop("disabled",true); // 减号设置为禁用
				
			}
			$numberObject.val(newNumber) // 重新赋值
			 $("#scenicCount").text(newCount);
		});
		
		
		//设置关闭按钮监听事件
		$("#btnClose").click(function(){
			$("#scenicCount").text("1");
			$("#scenicprice").val(scenicPriceValue);
		});
		// 百度地图API功能
		function G(id) {
			return document.getElementById(id);
		}
	
		var map = new BMap.Map("l-map");
		map.centerAndZoom("厦门",14);                   // 初始化地图,设置城市和地图级别。
		map.enableScrollWheelZoom(true);
		var ac = new BMap.Autocomplete(    //建立一个自动完成的对象
			{"input" : "suggestId"
			,"location" : map
		});
	
		ac.addEventListener("onhighlight", function(e) {  //鼠标放在下拉列表上的事件
		var str = "";
			var _value = e.fromitem.value;
			var value = "";
			if (e.fromitem.index > -1) {
				value = _value.province +  _value.city +  _value.district +  _value.street +  _value.business;
			}    
			str = "FromItem<br />index = " + e.fromitem.index + "<br />value = " + value;
			
			value = "";
			if (e.toitem.index > -1) {
				_value = e.toitem.value;
				value = _value.province +  _value.city +  _value.district +  _value.street +  _value.business;
			}    
			str += "<br />ToItem<br />index = " + e.toitem.index + "<br />value = " + value;
			G("searchResultPanel").innerHTML = str;
		});
	
		var myValue;
		ac.addEventListener("onconfirm", function(e) {    //鼠标点击下拉列表后的事件
		var _value = e.item.value;
			myValue = _value.province +  _value.city +  _value.district +  _value.street +  _value.business;
			G("searchResultPanel").innerHTML ="onconfirm<br />index = " + e.item.index + "<br />myValue = " + myValue;
			
			setPlace();
		});
	
		function setPlace(){
			map.clearOverlays();    //清除地图上所有覆盖物
			function myFun(){
				var pp = local.getResults().getPoi(0).point;    //获取第一个智能搜索的结果
				map.centerAndZoom(pp, 18);
				map.addOverlay(new BMap.Marker(pp));    //添加标注
			}
			var local = new BMap.LocalSearch(map, { //智能搜索
			  onSearchComplete: myFun
			});
			local.search(myValue);
		}
		
		
		//显示景点评论信息
		
		 $.ajax({
			 async:true,
			 type:"get",
			 url:"${pageContext.request.contextPath}/ScenicCommentServlet",
			 data:{
			 },
			 dataType:"json",
			 success:function(result){
				// 调用渲染函数
				 var content="";
					//没有数据
					if(result.length==0){
						$("#testimonialFor").html("");
					}else{
						for(var i=0;i<result.length;i++){
							if(scenicIdValue==result[i].scenicId){
								content += "<div class=\"author-img animate-img\">"+
	                            "<img style=\"width:50px;height:50px;\" src=\"${pageContext.request.contextPath}/FileDownloadServlet?fileName="+result[i].user.userPicture+"  \" class=\"rounded-circle\" alt=\"#\">"+
	                            "<span style=\"margin-left:15px;color:black;font-size:15px;\" class=\"text-theme fs-14\">"+result[i].user.userName+"</span>"+
	                            "<span style=\"float:right;margin-top:15px;\" class=\"text-theme fs-14\">"+result[i].commentDatetime+"</span>"+
	                    "</div>"+
	                     "<p style=\"margin-left:15px;margin-top:15px;\" class=\"text-light-dark\">"+result[i].commentContent+"</p>";
							}
					}
					
				}
					$("#scenicComment").html(content);
			 },
			 error:function(){
				 alert("异步请求失败!");
			 }
		 });
		 
		//发表评论信息
		
		$("#publishCommentScenic").click(function(){
			var commentContent = $("#inputScenicComment").val();
			
			var date = new Date();
			var year = date.getFullYear();
			var month = date.getMonth()+1;
			var day = date.getDay()+1;
			var hour = date.getHours();
			var minute = date.getMinutes();
			var second = date.getSeconds();
			
			var showTime = year+"/"+month+"/"+day+" "+hour+":"+minute+":"+second;
			
			console.log(showTime);
			 $.ajax({
				 async:true,
				 type:"get",
				 url:"${pageContext.request.contextPath}/ScenicCommentServlet",
				 data:{
					 op:"publishComment",
					 commentContent: commentContent,
					 commentDatetime:showTime, 
					 userId:"${sessionScope.user.userId}",
					 scenicId:scenicIdValue
				 },
				 dataType:"json",
				 success:function(result){
					 $("#inputScenicComment").val("");
					// 调用渲染函数
					 var content="";
						//没有数据
						if(result.length==0){
							$("#testimonialFor").html("");
						}else{
							for(var i=0;i<result.length;i++){
								if(scenicIdValue==result[i].scenicId){
									content += "<div >"+
									"<div \" class=\"author-img animate-img\">"+
		                            "<img style=\"width:50px;height:50px;\" src=\"${pageContext.request.contextPath}/FileDownloadServlet?fileName="+result[i].user.userPicture+"  \" class=\"rounded-circle\" alt=\"#\">"+
		                            "<span style=\"margin-left:15px;color:black;font-size:15px;\" class=\"text-theme fs-14\">"+result[i].user.userName+"</span>"+
		                            "<span style=\"float:right;margin-top:15px;\" class=\"text-theme fs-14\">"+result[i].commentDatetime+"</span>"+
		                    "</div>"+
		                     "<p style=\"margin-left:15px;margin-top:15px;\" class=\"text-light-dark\">"+result[i].commentContent+"</p>"+
		                     "</div>";
		                     
								}
						}
						
					}
						$("#scenicComment").html(content);
				 },
				 error:function(){
					 alert("异步请求失败!");
				 }
			 });
		});
		
		$(document).on("click","#btnLogout",function(){
			
			location.href = "${pageContext.request.contextPath}/front/userLogin.jsp";
		});
	});
</script>
</html>